"""

    公共元素

"""
from basePage.basepage import BasePage
from PIL.ImageGrab import grab
class CommEle(BasePage):

    """ 跳转到弹框"""
    def switch_to_alert(self):
        alert = self.driver.switch_to.alert
        text = alert.text
        alert.accept()
        return text

    """ 却换表单 """
    def switch_to_frame(self):
        return self.driver.switch_to.frame()

    """  切换到父表单  """
    def switch_to_parentframe(self):
        return self.driver.switch_to.parent_frame()

    """  却换到默认表单 """
    def switch_to_default_content(self):
        return self.driver.switch_to.default_content()

    """  截图  """
    def get_picture(self):
        img = grab()
        img.size()
